httpd.conf variables : What is the difference between ${var} and %{var}?

Posted by 108.im on Server Fault See other posts from Server Fault or by 108.im
Published on 2012-03-31T22:01:03Z Indexed on 2012/04/04 5:31 UTC
Read the original article Hit count: 473

Filed under:
|
|

What is the difference between ${var} and %{var} in httpd.conf?

How and when would one use ${} and %{}?

http://httpd.apache.org/docs/2.4/configuring.html mentions :

The values of variables defined with the Define of or shell environment variables can be used in configuration file lines using the syntax ${VAR}.

http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html mentions:

Server-Variables:These are variables of the form %{ NAME_OF_VARIABLE }

and

RewriteMap expansions:These are expansions of the form ${mapname:key|default}.

Will ${VAR} be used everywhere in httpd.conf, except in mod_rewrite directive's (like RewriteCond, RewriteRule but except for RewriteMap expansions which use ${} as in RewriteRule ^/ex/(.*) ${examplemap:$1} )

Would a variable set in httpd.conf using SetEnvIf Directive, for use in same httpd.conf, be used as ${var} except when the variable is used with mod_rewrite directive's, where the variable would be used as %{var}?

© Server Fault or respective owner

Related posts about apache2

Related posts about httpd.conf